Fall back when IBKR historical data is empty - #106
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5510c3d38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if unit == "D": | ||
| if quantity > 365: | ||
| return f"{ceil(quantity / 365)}y" | ||
| return f"{max(quantity, 1)}d" |
There was a problem hiding this comment.
Map day durations to valid yfinance periods
The fallback currently converts IBKR day windows to "{N}d" (for example "10 D" becomes "10d"), but yfinance.download(period=...) only accepts a fixed set of period values and rejects arbitrary day counts. In this codebase, _build_historical_close_map calls the loader with duration="10 D", so when IBKR returns no data the yfinance fallback hits an invalid period, gets caught, and silently returns an empty series—defeating the new fallback path for close-history prechecks.
Useful? React with 👍 / 👎.
Summary
Tests
Deployment